home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / ZIPPED / WINDOWS / PRINTERS / NODEE1A.ZIP / NODEE3.CPP < prev    next >
C/C++ Source or Header  |  1991-08-30  |  15KB  |  690 lines

  1. /*  No control D
  2. NOCTRL.CPP
  3.  
  4. written by James D. Rudnicki
  5.  
  6. written in  C++ Version */
  7.  
  8. // Access the libraries needed
  9.  
  10.     #if !defined(__WINDOWS_H)
  11.         #include <windows.h>
  12.     #endif
  13.  
  14.     #include <stdlib.h>
  15.     #include <stdio.h>
  16.     #include <iostream.h>
  17.     #include <fstream.h>
  18.  
  19.     #ifndef __STRING_H
  20.         #include <string.h>
  21.     #endif
  22.  
  23. /* Attach a debug header - to remove debug code compile
  24. with compiler switch -D NDEBUG  */
  25.  
  26. //    #include "debug.h"
  27.  
  28. // symbol tables
  29.     #ifndef __NOD1_H
  30.     #include "nod1.h"
  31.     #endif
  32.  
  33.  
  34. /*-------------------------------------------
  35. All dialog boxes are included from a separate file.
  36. An independent symbol table is used. */
  37.  
  38.     #ifndef __CLASSWIN_H
  39.         #include "classwin.h"
  40.     #endif
  41.     #ifndef _NODDLGS_H
  42.         #include "noddlgs.h"
  43.     #endif
  44.     #ifndef __NODCHILD_H
  45.         #include "nodchild.h"
  46.     #endif
  47.  
  48.  
  49. /*------------------------------------------------------------
  50.  The Main Window class
  51.  
  52. NoDWindow - constructor reads the private profile strings
  53.  
  54. ~NoDWindow - writes out the private profile strings
  55.  
  56. */
  57.  
  58.     #pragma arsused
  59.  
  60.     class NoDWindow : public Window
  61.     {
  62.     public:
  63.         NoDWindow();
  64.         ~NoDWindow();
  65.  
  66.     protected:
  67.         virtual LONG dispatch(WORD,WORD,LONG);
  68.         virtual BOOL registerClass();
  69.         virtual BOOL createWindow();
  70.  
  71.     private:
  72.  
  73. /* defaults */
  74.  
  75.         char szDefDir[MAXPATH];
  76.         BOOL bOneClick;
  77.         BOOL bInstantStrip;
  78.         BOOL bUseFileMask;
  79.         BOOL bFirstRun;
  80.         char szFileMask[MAXFULLFILE];
  81.  
  82. // member data
  83.  
  84.         static char szClassName[14];
  85.         char szBuffer[MAXPATH];
  86.         char szFile[MAXPATH];
  87.         char szCleanFile[MAXPATH];
  88.         int cxChar,cxCaps,cyChar;
  89.         int cxClient,cyClient,cxBit,cyBit;
  90.         BOOL bValidFile;
  91.         HMENU hMenu;
  92.         OFSTRUCT ofs;
  93.  
  94. // these member functions process commands
  95.  
  96.         BOOL processMenuCommand(WORD,long);
  97.         BOOL processChildCommand(WORD,long);
  98.  
  99. // these member functions are the workers
  100.  
  101.         void flash(BOOL);
  102.  
  103.         void helpAboutBox(void);
  104.         void helpWroteBox(void);
  105.         void paint( void );
  106.         int strip();
  107.         BOOL test();
  108.  
  109.  
  110. // child windows are declared here and created later
  111.  
  112.         GoButton gb;
  113.         FirstLine fl;
  114.         FileFinder childFileList;
  115.         DBox dbox;
  116.  
  117.  
  118.     };
  119.  
  120.  
  121.     char NoDWindow::szClassName[] = "No ^D !";
  122.  
  123. /* The constructor and destructors read and write the default
  124. values to the private initialization file */
  125.  
  126.     NoDWindow::NoDWindow()
  127.     {
  128.         if    (GetPrivateProfileString
  129.                 ("NoDee","Mask","",szFileMask,MAXFULLFILE,"nodee.ini") != 0)
  130.         {
  131.             bFirstRun=FALSE;
  132.  
  133.             GetPrivateProfileString
  134.                 ("NoDee","DefDir","",szDefDir,MAXPATH,"nodee.ini");
  135.  
  136.             bOneClick =
  137.                 (GetPrivateProfileInt("NoDee","OneClick",1,"nodee.ini") == 0)
  138.                 ? FALSE : TRUE;
  139.  
  140.             bInstantStrip =
  141.                 (GetPrivateProfileInt("NoDee","InstantStrip",1,"nodee.ini") == 0)
  142.                  ? FALSE : TRUE;
  143.  
  144.             bUseFileMask =
  145.                 (GetPrivateProfileInt("NoDee","UseMask",1,"nodee.ini") == 0)
  146.                  ? FALSE : TRUE;
  147.  
  148.         }
  149.         else
  150.         {
  151.             bFirstRun=TRUE;
  152.             strcpy(szFileMask,"*.PS");
  153.             bOneClick=FALSE;
  154.             bInstantStrip=FALSE;
  155.             bUseFileMask=FALSE;
  156.         }
  157.     }
  158.  
  159.     NoDWindow::~NoDWindow()
  160.     {
  161.         WritePrivateProfileString
  162.             ("NoDee","Mask",szFileMask,"nodee.ini");
  163.  
  164.         WritePrivateProfileString
  165.             ("NoDee","DefDir",szDefDir,"nodee.ini");
  166.  
  167.         WritePrivateProfileString
  168.             ("NoDee","OneClick",bOneClick ? "1" : "0","nodee.ini");
  169.  
  170.         WritePrivateProfileString
  171.             ("NoDee","InstantStrip",bInstantStrip ? "1":"0","nodee.ini");
  172.  
  173.         WritePrivateProfileString
  174.             ("NoDee","UseMask",bUseFileMask ? "1" : "0","nodee.ini");
  175.     }
  176.  
  177. /* Define the members of NoDWindow */
  178.  
  179.  
  180.         BOOL NoDWindow::registerClass( void )
  181.         {
  182.             WNDCLASS wc;
  183.  
  184.             wc.style         = CS_HREDRAW | CS_VREDRAW;
  185.             wc.lpfnWndProc   = &Window::wndProc;
  186.             wc.cbClsExtra    = 0;
  187.             wc.cbWndExtra    = 0;
  188.             wc.hInstance     = hInst;
  189.             wc.hIcon         = LoadIcon( hInst, "nodee" );
  190.             wc.hCursor       = LoadCursor( NULL, IDC_ARROW );
  191.             wc.hbrBackground = GetStockObject( WHITE_BRUSH );
  192.             wc.lpszMenuName  = "MENU";
  193.             wc.lpszClassName = (LPSTR)szClassName;
  194.  
  195.             return RegisterClass( &wc ) ;
  196.         }
  197.  
  198.  
  199.         BOOL NoDWindow::createWindow( void )
  200.         {
  201.             HDC hdc;
  202.             TEXTMETRIC tm;
  203.             int cx,cy;
  204.             cx=GetSystemMetrics(SM_CXSCREEN);
  205.             cy=GetSystemMetrics(SM_CYSCREEN);
  206.  
  207.             hWindow = CreateWindow
  208.                 ( szClassName,
  209.                     szClassName,
  210.                     WS_OVERLAPPED|WS_SYSMENU|WS_CAPTION|
  211.                     WS_DLGFRAME|WS_VISIBLE|WS_MINIMIZEBOX,
  212.                     CW_USEDEFAULT,CW_USEDEFAULT,
  213.                     3*cx/4,3*cy/4,
  214.                     NULL,
  215.                     NULL,
  216.                     hInst,
  217.                     NULL);
  218.  
  219.             if ( hWindow==0 )    return( FALSE );
  220.             insert();
  221.  
  222. /* the window handle is now valid - initialize global parameters */
  223.  
  224.             hdc=GetDC(hWindow);
  225.             SelectObject(hdc,GetStockObject(SYSTEM_FONT));
  226.             GetTextMetrics(hdc,&tm);
  227.             cxChar=tm.tmAveCharWidth;
  228.             cyChar=tm.tmHeight+tm.tmExternalLeading;
  229.             cxCaps=(tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar/2;
  230.             ReleaseDC(hWindow,hdc);
  231.  
  232.             hMenu=GetMenu(hWindow);
  233.  
  234. /* create child windows */
  235.  
  236.             dbox.create(hWindow);
  237.             gb.create(hWindow);
  238.             fl.create(hWindow);
  239.             fl.set(szCleanFile);
  240.  
  241.             childFileList.mask(bUseFileMask ? szFileMask : "*.*" );
  242.             childFileList.create(hWindow);
  243.  
  244. /* initialize the menu states and child windows */
  245.  
  246.             SetClassWord
  247.                 (childFileList.FileList::getHandle(), GCW_HCURSOR,    bInstantStrip ?
  248.                 LoadCursor(hInst,"NODEE"):LoadCursor(NULL,IDC_ARROW) );
  249.  
  250.             CheckMenuItem(hMenu,IDM_OPT1A,bInstantStrip ? MF_CHECKED:MF_UNCHECKED);
  251.             CheckMenuItem(hMenu,IDM_OPT1B,bOneClick ? MF_CHECKED:MF_UNCHECKED);
  252.             CheckMenuItem(hMenu,IDM_OPT1C,bUseFileMask ? MF_CHECKED:MF_UNCHECKED);
  253.  
  254.  
  255.             if (_fstrlen(WinBase::cmd)==0)
  256.                 strcpy(szCleanFile,"nothing selected");
  257.             else
  258.                 strcpy(szCleanFile,(char *)WinBase::cmd);
  259.  
  260.             test();
  261.  
  262.             ShowWindow(hWindow,show );
  263.             UpdateWindow(hWindow);
  264.  
  265.             if (bFirstRun)
  266.                 WinHelp(hWindow,HELPFILE,HELP_INDEX,NULL);
  267.  
  268.             return TRUE;
  269.         }
  270.  
  271.  
  272.     void NoDWindow::paint( void )
  273.     {
  274.         PAINTSTRUCT ps;
  275.         HDC hdc;
  276.         RECT rect;
  277.         hdc=BeginPaint( hWindow, &ps );
  278.         TextOut(hdc,cxChar,cyChar,
  279.             "Stripping ^D from:",18);
  280.         EndPaint( hWindow, &ps );
  281.     }
  282.  
  283.     void NoDWindow::flash(BOOL a)
  284.     {
  285.         BITMAP bm;
  286.         HDC hdcMem;
  287.         DWORD dwSize;
  288.         POINT ptSize,ptOrg;
  289.         HANDLE hPoint,hDC;
  290.         DWORD lParam;
  291.  
  292.         if (a)
  293.         {
  294.  
  295.         hPoint=LoadBitmap(WinBase::hInst,"D1");
  296.  
  297.         hDC=GetDC(hWindow);
  298.         hdcMem=CreateCompatibleDC(hDC);
  299.         SelectObject(hdcMem,hPoint);
  300.         SetMapMode(hdcMem,GetMapMode(hDC));
  301.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  302.         ptSize.x=bm.bmWidth;
  303.         ptSize.y=bm.bmHeight;
  304.         DPtoLP(hDC,&ptSize,1);
  305.         ptOrg.x=0;
  306.         ptOrg.y=0;
  307.         DPtoLP(hdcMem,&ptOrg,1);
  308.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  309.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  310.  
  311.         DeleteDC(hdcMem);
  312.         ReleaseDC(hWindow,hDC);
  313.  
  314.         }
  315.         else
  316.         {
  317.  
  318.  
  319.         hDC=GetDC(hWindow);
  320.         hdcMem=CreateCompatibleDC(hDC);
  321.  
  322.         hPoint=LoadBitmap(WinBase::hInst,"D1");
  323.         SelectObject(hdcMem,hPoint);
  324.         SetMapMode(hdcMem,GetMapMode(hDC));
  325.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  326.         ptSize.x=bm.bmWidth;
  327.         ptSize.y=bm.bmHeight;
  328.         DPtoLP(hDC,&ptSize,1);
  329.         ptOrg.x=0;
  330.         ptOrg.y=0;
  331.         DPtoLP(hdcMem,&ptOrg,1);
  332.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  333.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  334.  
  335.         hPoint=LoadBitmap(WinBase::hInst,"D2");
  336.         SelectObject(hdcMem,hPoint);
  337.         SetMapMode(hdcMem,GetMapMode(hDC));
  338.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  339.         ptSize.x=bm.bmWidth;
  340.         ptSize.y=bm.bmHeight;
  341.         DPtoLP(hDC,&ptSize,1);
  342.         ptOrg.x=0;
  343.         ptOrg.y=0;
  344.         DPtoLP(hdcMem,&ptOrg,1);
  345.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  346.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  347.  
  348.         hPoint=LoadBitmap(WinBase::hInst,"D3");
  349.         SelectObject(hdcMem,hPoint);
  350.         SetMapMode(hdcMem,GetMapMode(hDC));
  351.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  352.         ptSize.x=bm.bmWidth;
  353.         ptSize.y=bm.bmHeight;
  354.         DPtoLP(hDC,&ptSize,1);
  355.         ptOrg.x=0;
  356.         ptOrg.y=0;
  357.         DPtoLP(hdcMem,&ptOrg,1);
  358.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  359.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  360.  
  361.         hPoint=LoadBitmap(WinBase::hInst,"D4");
  362.         SelectObject(hdcMem,hPoint);
  363.         SetMapMode(hdcMem,GetMapMode(hDC));
  364.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  365.         ptSize.x=bm.bmWidth;
  366.         ptSize.y=bm.bmHeight;
  367.         DPtoLP(hDC,&ptSize,1);
  368.         ptOrg.x=0;
  369.         ptOrg.y=0;
  370.         DPtoLP(hdcMem,&ptOrg,1);
  371.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  372.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  373.  
  374.         hPoint=LoadBitmap(WinBase::hInst,"D4");
  375.         SelectObject(hdcMem,hPoint);
  376.         SetMapMode(hdcMem,GetMapMode(hDC));
  377.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  378.         ptSize.x=bm.bmWidth;
  379.         ptSize.y=bm.bmHeight;
  380.         DPtoLP(hDC,&ptSize,1);
  381.         ptOrg.x=0;
  382.         ptOrg.y=0;
  383.         DPtoLP(hdcMem,&ptOrg,1);
  384.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  385.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  386.  
  387.         hPoint=LoadBitmap(WinBase::hInst,"D5");
  388.         SelectObject(hdcMem,hPoint);
  389.         SetMapMode(hdcMem,GetMapMode(hDC));
  390.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  391.         ptSize.x=bm.bmWidth;
  392.         ptSize.y=bm.bmHeight;
  393.         DPtoLP(hDC,&ptSize,1);
  394.         ptOrg.x=0;
  395.         ptOrg.y=0;
  396.         DPtoLP(hdcMem,&ptOrg,1);
  397.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  398.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  399.  
  400.         DeleteDC (hdcMem);
  401.         ReleaseDC(hWindow,hDC);
  402.  
  403.         }
  404.  
  405.     }
  406.  
  407.     int NoDWindow::strip()
  408.     {
  409.         char str[80];
  410.         int j,i;
  411.         OFSTRUCT o;
  412.  
  413.         OpenFile((LPSTR)szCleanFile,&o,OF_READ|OF_EXIST);
  414.  
  415.         ifstream io((char *)o.szPathName);
  416.         if ( !io )
  417.         {
  418.             MessageBox(hWindow,"File did not open",
  419.                 (LPSTR)szCleanFile,MB_ICONSTOP|MB_OK);
  420.             return 0;
  421.         }
  422.         else
  423.         {
  424.             io.getline(str,80);
  425.             io.close();
  426.             if (strchr(str,4) != NULL);
  427.             {
  428.                 fstream io((char *)o.szPathName,ios::in|ios::out);
  429.                 io.seekp(0,ios::beg);
  430.  
  431.                 j=strlen(str);
  432.                 for(i=0;i<j;i++)
  433.                     if ( str[i] != 0x4)
  434.                         io.put(str[i]);
  435.                 io.close();
  436.  
  437.                 if (! bInstantStrip)
  438.                 MessageBox(hWindow,"File cleaned",
  439.                     (LPSTR)szCleanFile,MB_ICONEXCLAMATION|MB_OK);
  440.  
  441.                 dbox.unset();
  442.                 EnableWindow(gb.getHandle(),FALSE);
  443.                 SetFocus(hWindow);
  444.                 return 1;
  445.             }
  446.         }
  447.         return 0;
  448.     }
  449.  
  450. #define SZPOSTSCRIPT "%!PS"
  451.     #pragma argsused
  452.     BOOL NoDWindow::test()
  453.     {
  454.         char str[80];
  455.         char str2[80];
  456.         BOOL i,j;
  457.         OFSTRUCT o;
  458.  
  459.         OpenFile((LPSTR)szCleanFile,&o,OF_READ|OF_EXIST);
  460.  
  461.         ifstream io((char *)o.szPathName);
  462.         if ( io )
  463.         {
  464.             io.getline(str,80);
  465.             io.close();
  466.             i=(strstr(str,SZPOSTSCRIPT) != (char*)NULL) ;
  467.             j=(strchr(str,4) != (char *)NULL);
  468.             if (i && j)
  469.             {
  470.                 dbox.set();
  471.                 EnableWindow(gb.getHandle(),TRUE);
  472.                 SetFocus(gb.getHandle());
  473.                 return TRUE;
  474.             }
  475.         }
  476.         dbox.unset();
  477.         EnableWindow(gb.getHandle(),FALSE);
  478.         SetFocus(hWindow);
  479.         return FALSE;
  480.     }
  481.  
  482.  
  483.     void NoDWindow::helpWroteBox()
  484.     {
  485.         WhoWroteBox x(hWindow);
  486.         x.run();
  487.     }
  488.  
  489.     void NoDWindow::helpAboutBox()
  490.     {
  491.         AboutBox x(hWindow);
  492.         x.run();
  493.     }
  494.  
  495.     #pragma argsused
  496.     BOOL NoDWindow::processMenuCommand(WORD wParam, long lParam)
  497.     {
  498.         switch(wParam)
  499.         {
  500.         case IDM_OPT1A:
  501.             bInstantStrip=!bInstantStrip;
  502.             if (bInstantStrip)
  503.             {
  504.                 CheckMenuItem(hMenu,IDM_OPT1A,MF_CHECKED);
  505.                 SetClassWord
  506.                     (childFileList.FileList::getHandle(),GCW_HCURSOR,LoadCursor(hInst,"NODEE"));
  507.             }
  508.             else
  509.             {
  510.                 CheckMenuItem(hMenu,IDM_OPT1A,MF_UNCHECKED);
  511.                 SetClassWord
  512.                     (childFileList.FileList::getHandle(),GCW_HCURSOR,LoadCursor(NULL,IDC_ARROW));
  513.             }
  514.             if (bInstantStrip && test())
  515.                 strip();
  516.             return TRUE;
  517.  
  518.         case IDM_OPT1B:
  519.             CheckMenuItem(hMenu,IDM_OPT1B,(bOneClick = !bOneClick) ?
  520.                 MF_CHECKED:MF_UNCHECKED);
  521.             return TRUE;
  522.  
  523.         case IDM_OPT1C:
  524.             CheckMenuItem(hMenu,IDM_OPT1C,(bUseFileMask = !bUseFileMask) ?
  525.                 MF_CHECKED:MF_UNCHECKED);
  526.             childFileList.mask(bUseFileMask ? szFileMask : "*.*" );
  527.             childFileList.reset();
  528.             return TRUE;
  529.  
  530.  
  531.         case IDM_H1A:
  532.             helpWroteBox();
  533.             flash(TRUE);
  534.             return TRUE;
  535.  
  536.         case IDM_H1B:
  537.             helpAboutBox();
  538.             flash(FALSE);
  539.             return TRUE;
  540.  
  541.         case IDM_H1C:
  542.             WinHelp(hWindow,HELPFILE,HELP_INDEX,NULL);
  543.             return TRUE;
  544.  
  545.         default:
  546.             return FALSE;
  547.         }
  548.     }
  549.  
  550.     BOOL NoDWindow::processChildCommand(WORD wParam, long lParam)
  551.     {
  552.         int i;
  553.         switch(wParam)
  554.         {
  555.         case MYCW_ICKBUTTON:
  556.         case MYCW_GOBUTTON:
  557.             strip();
  558.             return TRUE;
  559.  
  560.         case MYCW_FILELIST:
  561.             if ( (HIWORD (lParam) == LBN_DBLCLK ) ||
  562.                      bOneClick && (HIWORD (lParam) == LBN_SELCHANGE) )
  563.             {
  564.                 if (childFileList.fileClick())
  565.                 {
  566.                     if (childFileList.validFile())
  567.                     {
  568.                         strcpy(szCleanFile,childFileList.getFile());
  569.                         fl.set(szCleanFile);
  570.                         if (test() && bInstantStrip)
  571.                             strip();
  572.                     }
  573.                     return TRUE;
  574.                 }
  575.             }
  576.             return FALSE;
  577.  
  578.         case MYCW_DIRLIST:
  579.         case MYCW_DIRFIELD:
  580.             if ( (HIWORD (lParam) == LBN_DBLCLK ) ||
  581.                      bOneClick && (HIWORD (lParam) == LBN_SELCHANGE) )
  582.             {
  583.                 if (childFileList.dirClick())
  584.                 {
  585.                     fl.set("none selected");
  586.                     return TRUE;
  587.                     dbox.unset();
  588.                     EnableWindow(gb.getHandle(),FALSE);
  589.                     SetFocus(hWindow);
  590.                 }
  591.             }
  592.             return FALSE;
  593.  
  594.         }
  595.         return FALSE;
  596.     }
  597.  
  598. /* This is the big switch
  599.  
  600. NOTE: Do no process the WM_CREATE message here.
  601. Upon the WM_CREATE message, the handle hWnd is not yet
  602. valid.  Do not use the handle until the CreateWindow call in the
  603. constructor has completed execution.  Any code which need be executed
  604. on creation can be placed in the create function .
  605.  
  606. This differs from normal C programs.  When CreateWindow sends the WM_CREATE
  607. message, the window handle is also passed to WndProc.  Thereby, the
  608. first processing of WM_CREATE will have access to the handle. */
  609.  
  610.     long NoDWindow::dispatch( WORD iMessage, WORD wParam, LONG lParam )
  611.     {
  612.         switch (iMessage)
  613.         {
  614.  
  615.             case WM_PAINT:
  616.                 paint();
  617.                 return 0;
  618.  
  619.             case WM_SIZE:
  620.                 cxClient=LOWORD(lParam);
  621.                 cyClient=HIWORD(lParam);
  622.                 return 0;
  623.  
  624. /* commands are send to the Menu processor, and then the Child processor
  625. If neither of these routines indicates it handled the command, the
  626. default procedure will be called. */
  627.  
  628.             case WM_COMMAND:
  629.                 if(processMenuCommand(wParam,lParam))
  630.                     return 0;
  631.                 if(processChildCommand(wParam,lParam))
  632.                     return 0;
  633.                 break;
  634.  
  635. /* catch this message - The file list should be updated when the
  636. program has not been active. */
  637.  
  638.             case WM_ACTIVATEAPP:
  639.                 if(wParam != 0)
  640.                 {
  641.                     childFileList.reset();
  642.                     SetClassWord
  643.                         (childFileList.FileList::getHandle(),GCW_HCURSOR,bInstantStrip?
  644.                         LoadCursor(hInst,"NODEE"):LoadCursor(NULL,IDC_ARROW) );
  645.                 }
  646.                 else
  647.                 {
  648.                     SetClassWord
  649.                         (childFileList.FileList::getHandle(), GCW_HCURSOR,
  650.                          LoadCursor(NULL,IDC_ARROW) );
  651.                 }
  652.  
  653.                 return 0;
  654.  
  655.             case WM_DESTROY:
  656.                 SetClassWord
  657.                 (childFileList.FileList::getHandle(), GCW_HCURSOR,
  658.                  LoadCursor(NULL,IDC_ARROW) );
  659.                 WinHelp(hWindow,HELPFILE,HELP_QUIT,NULL);
  660.  
  661.                 PostQuitMessage( 0 );
  662.                 return 0;
  663.  
  664.         }
  665.  
  666.         return Window::dispatch( iMessage, wParam, lParam );
  667.  
  668.     }
  669.  
  670.  
  671. /*-------------------------------------------------------------
  672. This is the end of the Main program.  The following procedures are
  673. called from Windows directly */
  674.  
  675.  
  676.  
  677.     int PASCAL WinMain
  678.         (HANDLE hInstance,HANDLE hPrev,LPSTR lpszCmdLine,int nCmdShow)
  679.     {
  680.         WinBase::hInst = hInstance;
  681.         WinBase::hPrevInst = hPrev;
  682.         WinBase::cmd = lpszCmdLine;
  683.         WinBase::show = nCmdShow;
  684.  
  685.         NoDWindow A;
  686.         A.create();
  687.         return A.run();
  688.     }
  689.  
  690.